<?php

use Phalcon\Mvc\Application;
use Phalcon\Exception;

date_default_timezone_set('PRC');

$config = include __DIR__ . '/../app/config/config.default.php';

$debug = $config->debug;
if ($debug) {

    error_reporting(E_ALL);
    ini_set('display_errors', 1);

    $debug = new \Phalcon\Debug();
    $debug->listen();

    require __DIR__ . '/../app/config/services.php';
    $application = new Application($di);
    require __DIR__ . '/../app/config/modules.php';
    echo $application->handle()->getContent();

} else {
    try {

        require __DIR__ . '/../app/config/services.php';
        $application = new Application($di);
        require __DIR__ . '/../app/config/modules.php';
        echo $application->handle()->getContent();

    } catch (Exception $e) {
        echo get_class($e), ": ", $e->getMessage(), "<br/>\n";
        echo " File=", $e->getFile(), "<br/>\n";
        echo " Line=", $e->getLine(), "<br/>\n";
        echo $e->getTraceAsString();
    }
}





